from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
    temperature=0,
    openai_api_key="sk-rgymzddvnnrgwawnkevkdzlxkxfvhbviqgibbfgpvsyoqtur",
    openai_api_base="https://api.siliconflow.cn/v1",
    model="deepseek-ai/DeepSeek-R1-0528-Qwen3-8B"
)

for chunk in llm.stream("写一个300字的小说？"):
    if chunk.content:
        print(chunk.content, end='', flush=True)